//
//  ExhibitWorkDetailsMainModel.m
//  ArtDog
//
//  Created by dllo on 16/9/20.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "ExhibitWorkDetailsMainModel.h"
#import "ExhibitWorkUserModel.h"

@implementation ExhibitWorkDetailsMainModel

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        _idField = value;
    }
}

- (void)setValue:(id)value forKey:(NSString *)key
{
    [super setValue:value forKey:key];
    if ([key isEqualToString:@"praiseUsers"]) {
        NSMutableArray<ExhibitWorkUserModel *> *array = [NSMutableArray array];
        for (NSDictionary *dic in value) {
            ExhibitWorkUserModel *userModel = [ExhibitWorkUserModel modelWithDic:dic];
            [array addObject:userModel];
        }
        _praiseUsers = array;
    }
    if ([key isEqualToString:@"user"]) {
        _user = [ExhibitWorkUserModel modelWithDic:value];
    }
}

@end
